function getBirthdayFromIdCard(idCard) {
  return new Promise((resolve) => {
    let birthday = "";
    let stareTime = new Date("1997-07-01").getTime();
    let endTime = new Date("2001-06-30").getTime();
    if (idCard) {
      if (idCard.length == 15) {
        birthday = "19" + idCard.substr(6, 6);
      } else if (idCard.length == 18) {
        birthday = idCard.substr(6, 8);
      }

      birthday = birthday.replace(/(.{4})(.{2})/, "$1-$2-");
    }
    let value = false;
    let birthdayTime = new Date(birthday).getTime();
    if (birthdayTime >= stareTime && birthdayTime <= endTime) {
      value = true;
    }
    resolve(value)
  });
}
// console.log(getBirthdayFromIdCard('22'));
export {
  getBirthdayFromIdCard
}
